package rpg.client.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ActorInfo {
	public static class Builder {
		public Builder()  {
			super();
		}
		
		private Actor actor = null;
		public Builder actor(Actor a)  {
			actor = a;
			return this;
		}
		
		private Position position = Position.VOID;
		public Builder position(Position p)  {
			position = p;
			return this;
		}
		
		private Facing facing = Facing.NULL;
		public Builder facing(Facing f)  {
			facing = f;
			return this;
		}

		private final List<GameObject> wearing = new ArrayList<GameObject>();
		public Builder wearing(GameObject o)  {
			wearing.add(o);
			return this;
		}
		
		private final List<GameObject> inventory = new ArrayList<GameObject>();
		public Builder inventory(GameObject o)  {
			inventory.add(o);
			return this;
		}
		
		public ActorInfo build()  {
			return new ActorInfo(this);
		}
	}

	public static final List<ActorInfo> EMPTY_LIST = Collections.emptyList();
	
	private ActorInfo(Builder b)  {
		super();
		actor = b.actor;
		position = b.position;
		facing = b.facing;
		inventory = Collections.unmodifiableList(b.inventory);
		wearing = Collections.unmodifiableList(b.wearing);
	}

	private final Actor actor;
	public Actor getActor() {
		return actor;
	}
	
	private final Position position;
	public Position getPosition()  {
		return position;
	}
	
	private final Facing facing;
	public Facing getFacing()  {
		return facing;
	}
	
	private final List<GameObject> inventory;
	public List<GameObject> getInventory()  {
		return inventory;
	}
	
	private final List<GameObject> wearing;
	public List<GameObject> getWearing()  {
		return wearing;
	}
	
	public String toString()  {
		return "PlayerInfo #" + getActor().getId() + " " + getActor().getName() + " " + getActor().getGender();
	}
}
